DEFIN VARIABLE desc1 LIKE pt_desc1.
define buffer oadet for oa_det.

for each in_mstr no-lock where use-index in_site,
    each pt_mstr no-lock where pt_part  = in_part,
    FIRST  oa_det no-lock where oa_site  = in_site
                                  and oa_part  = in_part WITH FRAME a WIDTH 120 :
    desc1 = pt_desc1 + pt_desc2.
    DISP
        oa_det.oa_part FORMAT "X(30)".
    
    for EACH oadet no-lock where oadet.oa_site  = in_site
                                  and oadet.oa_part  = oa_det.oa_part 
                                  BREAK BY oadet.oa_part WITH FRAME a:
         IF NOT FIRST-OF(oadet.oa_part) THEN DO: 
           IF desc1 <> "" THEN DO:
              DISP 
                 desc1 @ oa_det.oa_part.
              desc1 = "".
           END.
         END. 
         DISP 
           oadet.oa_nbr 
           oadet.oa_line 
           oadet.oa_qty 
           oadet.oa_to_date 
           oadet.oa_site 
           oadet.oa_detail 
           oadet.oa_code 
           oadet.oa_fr_date 
           oadet.oa_review
           in_qty_oh
           .

         IF LAST-OF(oadet.oa_part) AND desc1 <> "" THEN DO:
             DOWN 1.
             DISP 
                desc1 @ oa_det.oa_part.
             desc1 = "".
         END.

         DOWN 1.
    END.
                                  
END.
